package cn.seaboot.admin.flake.service;

import cn.seaboot.admin.flake.bean.FlakeMapper;
import cn.seaboot.admin.flake.dao.FlakeMapperDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Service
 * 映射 [T_FLAKE_MAPPER]
 *
 * @author Mr.css on 2018-6-20
 */
@Service
public class FlakeMapperService {

    @Resource
    private FlakeMapperDao flakeMapperDao;

    /**
     * 增
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int insert(FlakeMapper pojo) {
        return flakeMapperDao.insert(pojo);
    }

    /**
     * 删
     *
     * @param id id
     * @return affected rows
     */
    public int deleteById(String id) {
        return flakeMapperDao.deleteById(id);
    }

    /**
     * 改
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int updateById(FlakeMapper pojo) {
        return flakeMapperDao.updateSampleById(pojo);
    }

    /**
     * 查
     *
     * @param id id
     * @return pojo
     */
    public FlakeMapper queryById(String id) {
        return flakeMapperDao.selectById(id);
    }

    /**
     * 查列表
     *
     * @param params 参数
     * @return list
     */
    public List<FlakeMapper> queryList(Map<String, Object> params) {
        return flakeMapperDao.selectList(params);
    }
}